<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <meta http-equiv="pragma" content="no-cache"/>
    <meta http-equiv="Expires" content="Wed, 26 Feb 1997 082157 GMT"/>
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta name="renderer" content="webkit">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <link href="bootstrap/css/bootstrap.css" rel="stylesheet">
    <link href="css/iconfont.css" rel="stylesheet">
    <link href="css/inco/iconfont.css" rel="stylesheet">
    <link href="css/base.css" rel="stylesheet">
    <link href="css/index.css" rel="stylesheet">
    <link href="css/common.css" rel="stylesheet">
    <link rel="stylesheet" href="plugins/layui/css/layui.css">
    <title>孙泰和</title>
    <style>
        .menuToggle {
            color: #FFFFFF;
            font-weight: 200;
            padding: 14px 20px 14px 25px;
            cursor: pointer;
            transition: all 0.5s ease;
        }

        .i-navbar.toggle {
            width: 0;
        }

        .page-container.toggle {
            margin-left: 0px!important;
        }

        #toggle_new,
        .menuToggle.toggle {
            display: none;
        }

        #toggle_new {
            color: #fff;
            font-size: 20px;
            position: fixed;
            top: 50%;
            left: 0px;
            cursor: pointer;
            display: inline-block;
            background: rgba(0,0,0,0.4);
            line-height: 63px;
            transform: translateY(-50%);
            border-radius: 0 4px 4px 0;
        }

        #toggle_new.active {
            display: block;
        }

        #scrollText {
            padding-top: 3px;
            margin-left: auto;
            margin-right: auto;
            height: 25px;
            line-height: 25px;
        }

        .toolBox {
            position: fixed;
            top: 5px;
            right: -135px;
            transition: ease 0.5s;
            text-align: center;
            color: #fff;
            cursor: pointer;
            z-index: 99999;
        }

        .toolBox:hover {
            transform: translateX(-130px);
        }

        .toolLeft {
            width: 30px;
            height: 30px;
            line-height: 30px;
            background-color: #000;
            opacity: 0.8;
            position: absolute;
            font-size: 22px;
            top: 5px;
            left: -30px;
            border-radius: 3px 0 0 3px;
        }

        .toolRight {
            border-radius: 3px 0 0 3px;
            overflow: hidden;
            background-color: #000;
            opacity: 0.8;
            letter-spacing: 3px;
        }

        .toolRight div {
            box-sizing: border-box;
            height: 45px;
            width: 130px;
            line-height: 45px;
            margin: 5px 0 5px 5px;
            border-radius: 3px;
            text-align: left;
            padding-left: 20px;
        }

        .toolRight div:hover {
            transition: ease 0.3s;
            background-color: #2788c1;
        }
        .toolRight i{
            margin-right: 5px;
        }

        /* 正在进行医保结算的提示 */
        .health-care-init {
            background: rgba(0, 0, 0, 0.4);
            width: 100%;
            height: 100%;
            position: fixed;
            top: 0;
            left: 0;
            font-size: 22px;
            z-index: 9999;
            text-align: center;
            padding-top: 20%;
            color: #000;
        }

        .health-care-init i {
            font-size: 26px;
        }
        .layui-nav {
            overflow-y: scroll;
            height: 100%;
            padding-bottom: 46px;
        }
        #footer {
            height: 40px;
            line-height: 40px;
            position: fixed;
            bottom: 0;
            width: 100%;
            text-align: center;
            background: #393D49;
            color: #fff;
            font-family: Arial;
            font-size: 12px;
            letter-spacing: 1px;
        }

    </style>
    <script src="js/dayjs.min.js"></script>
    <script src="js/dayjs-local.js"></script>
    <script src="js/axios.min.js"></script>
</head>
<body class="bg-block fix-nav" style="overflow: hidden;">

<div class="i-container">
    <span id='toggle_new' class="iconfont" onclick='toggle()'> &#xeb09;</span>
    <nav class="i-navbar">
        <div class="menuToggle">
            <span>孙泰和</span>
            <span id='toggle' class="iconfont" style="float:right;font-size:20px;" onclick='toggle()'> &#xeb0a;</span>
        </div>
        <ul class="layui-nav layui-nav-tree" lay-shrink="all"></ul>
    </nav>
    <!--右侧内容开始-->
    <div class="page-container">
        <div class="page-content">
            <iframe class="i-frame" src="" frameborder="0" seamless name="content"></iframe>
        </div>
    </div>

    <div class="toolBox">
        <div class="toolLeft layui-icon">&#xe614;</div>
        <div class="toolRight">
<!--            <div onclick="redirects('mine')"><i class="glyphicon glyphicon-user" aria-hidden="true"></i>我的账号</div>-->
            <div onclick='quit()'><i class="glyphicon glyphicon-off red"></i>退出登录</div>
        </div>
    </div>
</div>
<object style="border:0px;" type="text/x-scriptlet" data="pages/Statis/dataview/views/index.html" width="100%" height="100%"></object>
<div id="footer">技术支持：杭州品言营销策划有限公司</div>
<webview></webview>
<!-- normal script imports etc  -->
<script>if (typeof module === 'object') {
    window.module = module;
    module = undefined;
}</script>
<script src="plugins/jQuery/jquery-1.11.1.js"></script>
<script type="text/javascript" src="plugins/layui/layer.js"></script>
<script>if (window.module) module = window.module;</script>
<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="plugins/layui/layui.js"></script>
<script src="plugins/jQuery/jquery.mousewheel.js"></script>
<script src="js/param.js"></script>
<script src="js/tools.js"></script>
<script src="js/power.js"></script>
<script src="css/inco/iconfont.js"></script>
<script src="plugins/loading/loading.js"></script>
<script type="text/javascript" src="js/scrollText.js"></script>
<link rel="stylesheet" href="plugins/element_UI/index.css">
<script src="js/vue.js"></script>
<script src="plugins/element_UI/index.js"></script>
<script type="text/javascript">
    var sUserAgent = navigator.userAgent.toLowerCase();
    ScrollText($('#scrollText'), 20, screen.width * 0.8, $('#scrollText').text(), 'left', 0.1, 20);//滚动字幕
    layui.use('element', function(){});
    var user = JSON.parse(localStorage.getItem("user"));
    if (Param.user.loginId === '9989') $(".toolBox").fadeOut()
    Param.initPageParam();
    var medical
    var dialog
    var hisDebug
    var isReadCard
    var remote
	var package
    var electron
    let inChrome = false   // 判断是否是在浏览器中打开的页面
    if (/ipad|iphone|midp|rv:1.2.3.4|ucweb|android|windows ce|windows mobile/.test(sUserAgent)) {

    }else {
        try {
            dialog = nodeRequire('electron').remote.dialog
            remote = nodeRequire('electron').remote
            electron =nodeRequire('electron')
            let fs = nodeRequire("fs")
            const path = nodeRequire('path');
            let exePath = path.dirname(remote.app.getPath('exe'));
            exePath=path.join(exePath,'/resources/app/package.json')
            package = nodeRequire(exePath)
            exePath = path.dirname(remote.app.getPath('exe'));
            let configPath = path.join(exePath,"/resources/app/config.js")
            const config = nodeRequire(configPath)
            hisDebug   = config.getter("address:debug")
            isReadCard = config.getter("address:isReadCard")
            exePath = path.dirname(remote.app.getPath('exe'));

            medical = nodeRequire("medical")
            window.top.interface = {medical,dialog,remote,electron,hisDebug,isReadCard}
            if (medical != undefined){
                Param.isElectron = true
                Param.hisDebug   = hisDebug
                Param.isReadCard   = isReadCard
                Param.remote=remote
                Param.dialog=dialog
                Param.medical=medical
                Param.electron=electron
                Param.electron=nodeRequire('electron')
                if (Param.isElectron){
                    window.hisDebug = hisDebug
                    window.isReadCard =isReadCard
                    let twentyFourSolarTerms=new Map([
                        ['01.01',' ▪ 元旦'],
                        ['01.02',' ▪ 腊八节'],
                        ['01.17',' ▪ 小年'],
                        ['02.04',' ▪ 立春'],
                        ['02.19',' ▪ 雨水'],
                        ['03.05',' ▪ 惊蛰'],
                        ['03.20',' ▪ 春分'],
                        ['04.04',' ▪ 清明'],
                        ['04.19',' ▪ 谷雨'],
                        ['05.05',' ▪ 立夏'],
                        ['05.20',' ▪ 小满'],
                        ['06.05',' ▪ 芒种'],
                        ['06.20',' ▪ 夏至'],
                        ['07.06',' ▪ 小暑'],
                        ['07.22',' ▪ 大暑'],
                        ['08.07',' ▪ 立秋'],
                        ['08.22',' ▪ 处暑'],
                        ['09.07',' ▪ 白露'],
                        ['09.22',' ▪ 秋分'],
                        ['10.08',' ▪ 寒露'],
                        ['10.23',' ▪ 霜降'],
                        ['11.07',' ▪ 立冬'],
                        ['11.22',' ▪ 小雪'],
                        ['12.07',' ▪ 大雪'],
                        ['12.21',' ▪ 冬至'],
                        ['01.06',' ▪ 小寒'],
                        ['01.20',' ▪ 大寒']
                    ])
                    let solarTerms = twentyFourSolarTerms.get(dayjs().format('MM.DD'))==undefined?"":twentyFourSolarTerms.get(dayjs().format('MM.DD'))
                    // 获取语言配置对象
                    let debug= hisDebug===1?"  工程模式  ":"";
                    if(hisDebug===1){
                        debug = Param.host_url.includes("127.0.0.1")?"本地工程模式":"生产环境工程模式";
                    }else {
                        debug = Param.host_url.includes("127.0.0.1")?"本地模式":"生产环境";
                    }

                    $('title').text('中医馆信息管理系统 v'+package.version+ debug + '     ('+Param.user.name+'  --  '+ Param.user.loginId+')   '+ dayjs().locale(localeObject, null, true).format("YYYY年M月D日  HH:mm   dddd") + solarTerms)
                    setInterval(function () {
                        $('title').text('中医馆信息管理系统 v'+package.version + debug + '     ('+Param.user.name+'  --  '+ Param.user.loginId+')   '+ dayjs().locale(localeObject, null, true).format("YYYY年M月D日  HH:mm   dddd") + solarTerms)
                    },60000);
                }
            }
        }catch (e) {
            inChrome = true
        }
    }

    // 医生登录,直接加载默认页面
    if (true) {
        let url = "pages/Statis/dataview/views/index.html" // 判断是否为转方医生
        // let id = Param.user.sffId
        // if (id == "200000107" || id == "200000103" || id == "200000087" || id == "200000063" || id == "200000085" ||
        //     id == "200000100" || id == "200000102" || id == "200000364") {
        //     url = "pages/fastReg/fastReg.html?type=1&level=9"
        // }
        $("#scrollText").css("display","none")
        $(".i-frame").attr('src',url).css("display","inline-block")
    }

    //禁止后退键 作用于Firefox、Opera
    document.onkeypress = banBackSpace;
    //禁止后退键 作用于IE、Chrome
    document.onkeydown = banBackSpace;

    function forwardChronic(lt) {
        ajaxNormalPost("/LoginUser/getLoginUser", '', function (data) {
            var loginUser = data.data;
            var appId = loginUser.appId;
            var name = loginUser.name;
            var token = loginUser.token;
            var ltUrl = Param.chronic_url + "/webChronic/login_his.html?1=1&appId=" + appId + "&token=" + token;
            ltUrl = ltUrl + "&name=" + encodeURIComponent(name);
            log4j.info("ltUrl:" + ltUrl);
            $(lt).attr("lt-url", ltUrl);
        });
    }

    function newScroll() {

        $('.new-box').delegate('.new-item', 'click', function () {
            var flag = true
            var kId = $(this).attr('data-key');
            sessionStorage.setItem('recordId', kId)

            var $ul = $(".nav:first");
            var $li = ''



        })
        var list_height = $('.new-box').height();
        var len = 0;
        var index = setInterval(function () {
            len += 1
            $('.new-box').css('top', -len)
            if (len >= list_height) {
                len = 0
                setTimeout('newScroll()', 100)
                clearInterval(index)
            }
        }, 200)
        $('.new-box').mouseenter(function () {
            clearInterval(index);
            len = ((len / 20).toFixed(0)) * 20 - 3;
            $('.new-box').css('top', -len)
        })
        $('.new-box').mouseleave(function () {
            index = setInterval(function () {
                len += 1
                $('.new-box').css('top', -len)
                if (len >= list_height) {
                    len = 0
                }
            }, 200)
        })
    }



    if (/ipad|iphone|midp|rv:1.2.3.4|ucweb|android|windows ce|windows mobile/.test(sUserAgent)){

    }else {
        if (Param.user.sffType == 2) {
            // 操作人员工号,加载硬件信息
            loopJudgment();
        }
    }


    //setTimeout("loopJudgment()","500");
    //循环获取硬件信息，直到成功为止
    function loopJudgment() {
		setTimeout(() => {
			getSystemInfo()
		}, 2000);
	}

    //获取硬件信息
    function getSystemInfo() {
        var LODOP = getLodop();
        var HardwareInfo = {};
        HardwareInfo = localStorage.getItem('HardwareInfo');
        let MIHS = localStorage.getItem('MIHS')
        if (HardwareInfo && MIHS) {
            return true;
        } else if (HardwareInfo && !MIHS) {
            localStorage.removeItem('HardwareInfo')
        }
        //cpu序列号 MAC地址 IP地址
        var strINFOType = ['Processor.CPUID', 'NetworkAdapter.1.IPAddress', 'NetworkAdapter.1.PhysicalAddress'];
        var arr = [];
        for (var i = 0; i < strINFOType.length; i++) {
            LODOP.GET_SYSTEM_INFO(strINFOType[i])
            if (LODOP.CVERSION) CLODOP.On_Return = function (TaskID, Value) {
                arr.push(Value);
                if (arr.length == 3) {
                    sessionStorage.setItem('printTexts', JSON.stringify(arr))
                    log4j.info("printTexts写入缓存成功");
                    log4j.info("arr: " + arr);
                    HardwareInfo = {'cpuSerialNumber': arr[0], 'ipAddress': arr[1], 'macAddress': arr[2]};
                    log4j.info(HardwareInfo);
                    localStorage.setItem('HardwareInfo', JSON.stringify(HardwareInfo))
                    let params = {
                        macAddress: arr[2],
                        ipAddress: arr[1],
                        hospitalId: Param.user.hospitalId,
                        systemInfo: arr[0]
                    }
                    ajaxNormalPost("/pub/computer_hospital/updateOperatorMacInfo", params, () => {
                        localStorage.setItem('MIHS', "true")
                    })
                }
                throw new Error();
            };
        }
    }


    function toggle() {
        $('.i-navbar').toggleClass('toggle');
        // $('.nav').toggleClass('active');
        // $('.menuToggle>div').toggleClass('active');
        $('.menuToggle').toggleClass('toggle');
        $('.page-container').toggleClass('toggle');
        // $('.new-logo').toggleClass('active')
        // $('#toggle').toggleClass('active')
        $('#toggle_new').toggleClass('active')
    }

    function quit() {
        window.location.href = 'login.html'
        localStorage.removeItem('user')
    }

    // 系统通知
    function notice() {
        layer.msg('暂无通知')
    }

    // 我的账号 / 使用手册 / 医保记录
    function redirects(txt) {
        let url
        if (txt === 'mine') {
            url = "/pages/staffInfo/edit.html"
        } else if (txt === 'useManual') {
            url = "pages/useManual/pdf/web/viewer.html"
        }else {
            url = "pages/power/healthRecords.html"
        }
        $("#scrollText").fadeOut()
        $(".i-frame").attr("src",url).css("display","inline-block")
    }

    if(Param.isElectron) adu()
    else $(".health-care-init").css("display","none")






    // 窗口宽度小于1300 自动隐藏菜单栏
    let originW = $(window).width()
    $(window).resize(function() {
        let currentW = $(window).width()
        if (currentW < 1300 && currentW < originW) {
            if (!$(".i-navbar").hasClass('toggle')) {
                toggle()
            }
        }
        originW = currentW
    })

</script>

</body>
</html>
